﻿using System;
[assembly:CLSCompliant(true)]
namespace ServicesDirectory.Shares
{
    public partial class MainMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["UserInfo"] == null)
            //{
            //    var cookie = Request.Cookies["usercookie"];
            //    if(cookie != null)
            //    {
            //        var userBusiness = new UserBusiness();
            //        var user = userBusiness.GetUser(cookie.Value);
            //        var role = Enum.GetName(typeof(Role), Role.Normal);
            //        if (FormsAuthentication.Authenticate(role, role))
            //        {
            //            Session["UserInfo"] = user;
            //            FormsAuthentication.RedirectFromLoginPage(role, false);
            //        }
                    
            //    }
            //    else
            //    {
            //        FormsAuthentication.RedirectToLoginPage();
            //    }
            //}
            //else
            //{
            //    if (!IsPostBack)
            //    {
            //        var user = (User) Session["UserInfo"];
            //        lblWelcome.Text += user.Account + " ,<a href='../Login.aspx?fn=logout'>logout</a>";
            //    }
            //}
        }
    }
}